﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>
    <div class="path">
        <a href="/productcategory/index"><strong>类目管理</strong></a>
    </div>
    <div class="pd10">
        <div class="mb10 aR">
            <a href="javascript:;" title="新增" class="a-btn1" onclick="OpenPop('/Views/Category/Edit.aspx?pid=@ViewData["parentID"]', '新增商品类目',500,250)">新增</a> <a href="/Views/Category/index.aspx" title="返回大类" class="a-btn1">返回</a>
            <input id="pid" name="pid" type="hidden" value="" />
        </div>
        <span id="Grid">
            <table class="tb-list hover">
                <tr>
                    <th>
                        分类编号
                    </th>
                    <th>
                        分类名称
                    </th>
                    <th>
                        排序值
                    </th>
                    <th>
                        级别
                    </th>
                    <th>
                        更新时间
                    </th>
                    <th width="20%">
                        操作
                    </th>
                </tr>
                @foreach (OneMG.Phoenix.Service.Model.CategoryModel item in ViewData["listModle"] as List<OneMG.Phoenix.Service.Model.CategoryModel>)
				{
                <tr>
                    <td>
                        @item.CategoryID
                    </td>
                    <td>
                        <a href="/Category/index?pid=@item.CategoryID">@item.CategoryName</a>
                    </td>
                    <td>
                        @item.CateSort
                    </td>
                    <td>
                        @item.IsLeaf == true ? "二级分类" : "一级分类"
                    </td>
                    <td>
                        @item.UpdateTime 
                    </td>
                    <td>
                        <a href="javascript:void(showEdit('@item.CategoryID', '@item.ParentID'))">编辑</a> <a href="javascript:;" onclick="DeleteCategory('@item.CategoryID')">删除</a>
                        @if (item.IsLeaf)
						{
                        <a href="/Views/Category/index.aspx?pid=@item.CategoryID">子类目</a>
						}
                    </td>
                </tr>
				}
            </table>
        </span>
        <!-- 分页插件  -->
        <div id="pager" class="aR mt10">
        </div>
    </div>